<?php echo $this->doctype() ?> <!-- This Line will output the doctype we set inside the bootstrap file -->
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Hospital Application</title>
        <link rel="stylesheet" href="/CPSC471/public/css/global.css" type="text/css" />
        <script src="/CPSC471/public/jquery/development-bundle/jquery-1.6.2.js"></script>
	<script src="/CPSC471/public/jquery/development-bundle/ui/jquery.ui.core.js"></script>
	<script src="/CPSC471/public/jquery/development-bundle/ui/jquery.ui.widget.js"></script>
	<script src="/CPSC471/public/jquery/development-bundle/ui/jquery.ui.datepicker.js"></script>
        <link rel="stylesheet" href="/CPSC471/public/jquery/development-bundle/themes/custom-theme/jquery.ui.all.css">
    </head>
    <body>

        <!--
            Header
        -->
        
        <?php
        $sessionUser = new Zend_Session_Namespace('sessionUser');
        $tab = array();
		$tab2 = array();

        /** User Buttons **/
        switch ($sessionUser->UserType) {
            case "SECRETARY":
                $temp = $this->url(array('controller' => 'secretary', 'action' => 'index'), null, true);
                $tab[] = '<a href="' . $temp . '" >Home</a>';
        
                $temp = $this->url(array('controller' => 'alert', 'action' => 'viewreceivedalerts'), null, true);
	       	    $tab[] = '<a href="' . $temp . '" >Alerts</a>';
                
                $temp = $this->url(array('controller' => 'appointment', 'action' => 'appointment'), null, true);
                $tab[] = '<a href="' . $temp . '" >Appointments</a>';
                   
                $temp = $this->url(array('controller' => 'secretary', 'action' => 'doctor'), null, true);
                $tab[] = '<a href="' . $temp . '" >Doctor</a>';
                            
                $temp = $this->url(array('controller' => 'secretary', 'action' => 'patient'), null, true);
                $tab[] = '<a href="' . $temp . '" > Patient</a>';
                
                $temp = $this->url(array('controller' => 'patientfile', 'action' => 'browsepatientfile'), null, true);
                $tab[] = '<a href="' . $temp . '" >Patients File</a>';
                
                $temp = $this->url(array('controller' => 'secretary', 'action' => 'mealplan'), null, true);
                $tab[] = '<a href="' . $temp . '" >Meal Plan</a>';
                
                $temp = $this->url(array('controller' => 'secretary', 'action' => 'user'), null, true);
                $tab[] = '<a href="' . $temp . '" >Users</a>';
            
	            break;
	            
            case "PATIENT":
                $temp = $this->url(array('controller' => 'patient', 'action' => 'index'), null, true);
                $tab[] = '<a href="' . $temp . '" >Home</a>';
        
                $temp = $this->url(array('controller' => 'patient', 'action' => 'viewrental'), null, true);
                $tab[] = '<a href="' . $temp . '" >Rent a Dvd/Book</a>';
                
                $temp = $this->url(array('controller' => 'patient', 'action' => 'viewmealplan' ), null, true);
                $tab[] = '<a href="' . $temp . '" >Change Meal Plan</a>';

	            
	            break;
                
            case "DOCTOR":   
                $temp = $this->url(array('controller' => 'doctor', 'action' => 'index'), null, true);
                $tab[] = '<a href="' . $temp . '" >Home</a>';
        
                $temp = $this->url(array('controller' => 'schedule', 'action' => 'viewschedule'), null, true);
                $tab[] = '<a href="' . $temp . '" >My Schedule</a>';
                
                $temp = $this->url(array('controller' => 'patientfile', 'action' => 'browsepatientfile'), null, true);
                $tab[] = '<a href="' . $temp . '" >Patient File</a>';
                
                $temp = $this->url(array('controller' => 'alert', 'action' => 'viewreceivedalerts'), null, true);
                $tab[] = '<a href="' . $temp . '" >Alerts</a>';
	            
	            break;
        }
        
        /** Disconnect Button **/
        if ($sessionUser->UserType != null ) {
                $temp2 = $this->url(array('controller' => 'index', 'action' => 'logout'), null, true);
                $tab2[] = '<p style="position:relative; margin-top:-38px; margin-right:-1000px;"><a style="color:white;text-decoration:none;" onmouseover="this.style.color=\'#FBA403\';" onmouseout="this.style.color=\'white\';" href="' . $temp2 . '" >Sign Out</a></p>';
            } else {
                $temp2 = $this->url(array('controller' => 'index', 'action' => 'index'), null, true);
                $tab[] = '<a href="' . $temp2 . '" >Home</a>';
            }
        ?>

        <div id="header">
            <div class="header-logo">
                <img src="/CPSC471/public/redcross.gif" alt="logo"/>
                <h1>Hospital Application</h1>
            </div>

           

            <div class="header-menu">
                <ul>
                    <?php foreach ($tab as $t) : ?>
                        <li> <?php echo $t; ?> </li>
                    <?php endforeach; ?>
                    </ul>

                </div>
            </div>
            
            <?php if ($sessionUser->UserId != null) {  ?>

             <div id="id_connect">
            <?php echo " " . $sessionUser->FName . " " . $sessionUser->LName . " (" . $sessionUser->UserType . ")  "; ?>
          	</div>

		</div>


        <div><br/></div>

                   
        <?php } ?>

        <!-- 
            CONTENT
        -->
        <div id="content">
        <?php echo $this->layout()->content ?>
        </div>


        <!--
            Footer
        -->
        <div id="footer">
            <p>&copy; Hosseini S. - Korchynski C. - Vaidie P. 
         
            		<?php foreach ($tab2 as $t2) : ?>
                        <?php echo $t2; ?> 
                    <?php endforeach; ?>
            </p>
        </div>
    </body>
    
<script>
	$(function() {
		$( "#BeginDate" ).datepicker({dateFormat: 'yy-mm-dd'});
                $( "#EndDate" ).datepicker({dateFormat: 'yy-mm-dd'});
                $( "#date" ).datepicker({dateFormat: 'yy-mm-dd'});
                $( "#Date" ).datepicker({dateFormat: 'yy-mm-dd'});
	});
</script>

</html>
